//
//  XHImageView.m
//  SwiftCodeOc
//
//  Created by zhangjianyun on 17/6/30.
//  Copyright © 2017年 com.taihejiacheng. All rights reserved.
//

#import "XHImageView.h"
#import "SwiftCodeOc-Swift.h"

@implementation XHImageView

- (void)addTarget:(id)target withSeletor:(SEL)sel {
    _target = target;
    _sel = sel;
    self.userInteractionEnabled = YES;
    
    // 调用 swift 的方法
    TestSwift *swift = [[TestSwift alloc] init];
    [swift someFunc];
}
 

- (void)test {
    NSLog(@"test in XHImageView");
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    if (_target) {
        [_target performSelector:_sel withObject:self];
    }
}
@end

